home *** CD-ROM | disk | FTP | other *** search
- Path: ntc.nokia.com!news
- From: Risto Lankinen <risto.lankinen@ntc.nokia.com>
- Newsgroups: comp.lang.c++
- Subject: Re: How to copy text to Win95 clipboard?
- Date: Wed, 17 Apr 1996 08:48:03 -0700
- Organization: Nokia Telecommunications
- Message-ID: <317512B3.3469@ntc.nokia.com>
- References: <316ff634.6913883@news.demon.co.uk> <4kpl36$j8c@nntp1.best.com>
- NNTP-Posting-Host: pc-rlankinen.ntc.nokia.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (Win16; I)
-
- Hi!
-
- John Lockwood wrote:
- >
- > martin@mckean.demon.co.uk (Martin McKean) wrote:
- >
- > >How do I set up a handle to a character string so that I can put that
- > >string on the clipboard?
- >
- > >I'm using VC4++; grateful for any help!!
- >
- > Dude, here's a one-shot answer. But I really urge you to get a copy
- > of Charles Petzold's Programming Windows and read it.
-
- [answer deleted]
-
- Here's how I copy strings to clipboard:
-
- My string class has a static "EDIT" control (wrapped in another class
- so that it is appropriately created and deleted as the program begins
- and ends). The string class has a Clip() method, which sets the text
- of the "EDIT" control to 'this' string, selects all of the text, and
- sends the control a WM_COPY message. Voila!
-
- (That was really a simplification, because actually my "EDIT" control
- wrapper class is based on a virtual string interface class, so that
- an "EDIT" control really looks like a string. You can then assign a
- string to an "EDIT" control, or use it as an argument in Len(), Mid(),
- operator+() etc. string functions... but that's another story... )
-
- terv: Risto
-
- --
- Risto Lankinen / System Engineer ***************************************
- Nokia Telecommunications, * 2 2 *
- Cellular Data; Helsinki, Finland. * 2 -1 is PRIME! Now working on 2 +1 *
- risto.lankinen@ntc.nokia.com ***************************************
-